Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Manipulating Scale Transforms

QuickDraw 3D provides routines that you can use to create and manipulate scale transforms. A scale transform scales an object along the x , y , and z axes by specified values. You are responsible for ensuring that an object is at the correct location and in the proper orientation for the scaling to have the desired effect.

A scale factor can be negative. You should, however, exercise caution when using negative scale factors. In addition, when two or three of the scale factors are 0, nothing is drawn.

Q3ScaleTransform_New

You can use the Q3ScaleTransform_New function to create a new scale transform.

TQ3TransformObject Q3ScaleTransform_New (
                     const TQ3Vector3D *scale);
scale
A vector whose three fields specify the desired scaling along each coordinate axis.

DESCRIPTION

The Q3ScaleTransform_New function returns, as its function result, a reference to a new transform object of type kQ3TransformTypeScale using the data passed in the scale parameter. The scale transform scales an object by the values in scale->x , scale->y , and scale->z , respectively. The data you pass in the scale parameter is copied into internal QuickDraw 3D data structures. If QuickDraw 3D cannot allocate memory for those structures, Q3ScaleTransform_New returns the value NULL .

Q3ScaleTransform_Submit

You can use the Q3ScaleTransform_Submit function to submit a scale transform without creating an object or allocating memory.

TQ3Status Q3ScaleTransform_Submit (
                     TQ3Vector3D *scale,
                     TQ3ViewObject view);
scale
A vector whose three fields specify the desired scaling along each coordinate axis.
view
A view.

DESCRIPTION

The Q3ScaleTransform_Submit function pushes the scale transform specified by the scale parameter on the view transform stack of the view specified by the view parameter. The function returns kQ3Success if the operation succeeds and kQ3Failure otherwise.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3ScaleTransform_Get

You can use the Q3ScaleTransform_Get function to query the private data stored in a scale transform.

TQ3Status Q3ScaleTransform_Get (
                     TQ3TransformObject transform,
                     TQ3Vector3D *scale);
transform
A transform.
scale
A vector whose three fields specify the scaling along each coordinate axis.

DESCRIPTION

The Q3ScaleTransform_Get function returns, in the scale parameter, information about the scale transform specified by the transform parameter. You should use Q3ScaleTransform_Get only with transforms of type kQ3TransformTypeScale .

Q3ScaleTransform_Set

You can use the Q3ScaleTransform_Set function to set new private data for a scale transform.

TQ3Status Q3ScaleTransform_Set (
                     TQ3TransformObject transform,
                     const TQ3Vector3D *scale);
transform
A transform.
scale
A vector whose three fields specify the desired scaling along each coordinate axis.

DESCRIPTION

The Q3ScaleTransform_Set function sets the scale transform specified by the transform parameter to the data passed in the scale parameter. You should use Q3ScaleTransform_Set only with transforms of type kQ3TransformTypeScale .


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |